#ifndef CSTATICTEXT_H_HEADER_INCLUDED_B9A08104
#define CSTATICTEXT_H_HEADER_INCLUDED_B9A08104
#include "GUI.h"
#include "IElement.h"

//##ModelId=465F74F00128
class GUI_API CStaticText : public IElement
{
	struct TextBlock
	{
		int m_nCharLastLine;
		int m_nCharPrivLastLine;
		int m_nOffsetInFile;
		int m_nOffsetNextInFile;
		int m_nLines;
		int m_nBytesALastLine;
		int m_nBytesWLastLine;
		int m_nBytesAPrivLine;
		int m_nBytesWPrivLine;
	};
	int m_nNextRead;
	int m_nBytesInW;
	int m_nBytesInA;
	int m_scrollStart;
	bool m_bScroll;
	bool m_bEnd;
	WCHAR* pText1;
	wstring m_strfilename;
	int m_nCharLastLine;
	list<TextBlock> m_listTextBlock;
    //##ModelId=465F7599038A
    COLORREF m_color;

    //##ModelId=465F75C90271
    int m_nSize;

    //##ModelId=465F75EC0232
    wstring m_strStyle;
	wstring m_strText;
	
	int m_nStartline,m_nEndline;
	list<wstring> m_listMultiLine;
	list<wstring> m_listMem;
	map<int,long> m_mapTime;
	map<long,wstring> m_mapLyric;
	LPTSTR WrapString(LPTSTR lpText, WORD nMaxWidth, WORD *lpnLen);
	void   InitLyric();
     HBRUSH m_hBrush;
	DWORD m_nAlignFlag;
	WCHAR multiText[260];
	BOOL m_bMultiline;

public:
	CStaticText(const WCHAR * name,const WCHAR * text, RECT rct ,const WCHAR * font,COLORREF nColor,bool m_bScroll,const WCHAR * align = 0);
	virtual ~CStaticText();

	virtual void draw(HDC * hdc);
	virtual bool OnExit();
	virtual void acceptVisitor(IVisitor ** visitor);

	wstring getvalue(){return m_strText;}
	//void setvalue(const WCHAR* text);
	int setvalue( WCHAR* text,bool multiline = 0,bool inMem = false);
	int setvalue(const WCHAR* text,bool multiline = 0,bool inMem = false);

	void upLines(int lines = 1,WCHAR* pBuff = 0);
	void downLines(int lines = 1,WCHAR* pBuff = 0);
	bool scrollToTime(long timeoffset);

	void setlyric(WCHAR* text,bool multiline = 1 );
	void setFileName(const WCHAR *	filename);
	bool readNext(bool inMem = false);
	bool readPriv(bool inMem = false);
	
};



#endif /* CSTATICTEXT_H_HEADER_INCLUDED_B9A08104 */
